package org.practice.util;

import java.io.IOException;
import java.util.Properties;

public class PropertiesUtil {
	private static Properties prop=null;
	static{
		try {
			prop=new Properties();
			prop.load(PropertiesUtil.class.getResourceAsStream("/appresource.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static String getValue(String key){
		return prop.getProperty(key);
	}
	
    public static boolean isNeedActionTime() {
        String flag = prop.getProperty("needActionTime");
        if (flag != null)
            return Boolean.valueOf(flag);
        return false;
    }
    public static boolean isNeedPrintParam() {
    	String flag = prop.getProperty("needPrintParam");
    	if (flag != null)
    		return Boolean.valueOf(flag);
    	return false;
    }
	
}
